using net_work.Common.Request;
using net_work.Common.Result;
using net_work.Data.DTO.Appr;
using net_work.Data.Entity.Appr;

namespace net_work.IService.Appr;

public interface IFlowService
{
    /// <summary>
    /// 分页查询流程
    /// </summary>
    /// <param name="request">查询参数</param>
    /// <returns>分页结果</returns>
    Task<PagedResult<Flow>> GetFlowsPagedAsync(PagedRequest request);

    /// <summary>
    /// 根据流程ID查询流程信息
    /// </summary>
    /// <param name="flowId">流程ID</param>
    /// <returns>流程信息</returns>
    Task<Flow?> SelectByIdAsync(long flowId);

    /// <summary>
    /// 插入流程
    /// </summary>
    /// <param name="flowAddRequest">新增流程实体</param>
    /// <returns>新增流程ID</returns>
    Task<long> InsertFlow(FlowAddRequest flowAddRequest);

    /// <summary>
    /// 更新流程信息
    /// </summary>
    /// <param name="flowUpdateRequest">更新流程信息</param>
    /// <returns>是否成功</returns>
    Task<int> UpdateFlow(FlowUpdateRequest flowUpdateRequest);

    /// <summary>
    /// 删除流程
    /// </summary>
    /// <param name="ids">流程ID集合</param>
    /// <returns>是否成功</returns>
    Task<int> DeleteFlowByIds(List<long> ids);

    /// <summary>
    /// 发布流程
    /// </summary>
    /// <param name="flowId">流程ID</param>
    /// <returns>是否成功</returns>
    Task<int> ReleaseFlow(long flowId);
}